<!-- BEGIN VICTORY TAB -->
<div class="tab-pane" id="victory">
  <div class="row">

    <div class="col-md-6">

      <h2>Archive</h2>

      <p>Archived actions are hidden on the website and their tools are disabled. You should generally archive actions once they reach their end of life rather than deleting them.</p>
      <p>Archived actions are hidden from everywhere on the site except the dashboards of users who have already taken that action.</p>
      <p>You can optionally set up to redirect visitors to a different action page.</p>
      <h4>When a redirect is set:</h4>
      <ul>
        <li>Logged-in users who have already taken this action can still view the action (as a historical record). As a result, links from the list of completed actions in their dashboard will still work.</li>
        <li>Logged-in users who haven't taken this action and all logged-out users will be immediately redirected to the new page.</li>
      </ul>
      <h4>When the redirect is disabled:</h4>
      <ul>
        <li>All users will be shown the same message, indiciating that the action is archived.</li>
      </ul>

      <div class='panel panel-warning'>

        <div class='panel-heading'>
          <%= f.check_box :archived,
            data: {toggle: 'collapse', target: '#archived-fields'} -%>
          <%= f.label :archived do -%>Archive this action<% end -%>
        </div>

        <div id='archived-fields' class='panel-body collapse <%= 'in' if @actionPage.archived? -%>'>
          <div class="form-group">
            <%= f.label :archived_redirect_action_page_id do -%>Redirect:<% end %>
            <%= collection_select :action_page, :archived_redirect_action_page_id, ActionPage.all.where.not(id: @actionPage.id), :id, :title, {:include_blank => "  Disabled", :object => @actionPage} %>
          </div>
        </div><!-- #archived-fields -->

      </div><!-- .panel-warning -->
    </div><!-- .col-md-6 -->

    <div class="col-md-6">
      <h2>Victory</h2>

      <p>Ah, sweet, elusive victory ...</p>
      <p>Enabling this setting replaces the action with a victory message. In the future, we plan to add a "victorious campaigns" section of the website to showcase how awesome you and your organization are.</p>

      <div class='panel panel-success'>
        <div class='panel-heading'>
          <%= f.check_box :victory,
            data: {toggle: 'collapse', target: '#victory-fields'} -%>
          <%= f.label :victory do -%>Declare victory!<% end -%>
        </div>

        <div id='victory-fields' class='panel-body collapse <%= 'in' if @actionPage.victory? -%>'>
          <%= f.label :victory_message do -%>Set a victory message (supports markdown):<% end -%>
          <div class="epiceditor" id="epic-victory-message"></div>
          <%= f.text_area :victory_message, :id => 'victory-message', :style => 'display: none;' -%>
        </div>
      </div><!-- .panel-success -->

    </div><!-- .col-md-6 -->

  </div><!-- .row -->
</div><!-- .tab-pane -->
<!-- TABEND -->
